#ifndef TRANSFORM_H
#define TRANSFORM_H
#include "Troll3D_global.h"
#include <GeoTool/vec4.h>
#include <GeoTool/Matrix.h>
#include <QDebug>
#include <GeoTool/Quaternion.h>

class TROLL3DSHARED_EXPORT Transform
{
    /********************************
    /*          Public
    /********************************/
    public :

        /********************************
        /*          Constructors
        /********************************/

            Transform();
            Transform(Matrix4 & mat);
            Transform(Matrix4 * mat);

            void Initialize();

        /********************************
        /*          Methods
        /********************************/

            void Update();

            /********************************
            /*          Get
            /********************************/

                const vec4 & Up();
                 vec4 & Forward();
                const vec4 & Right();

                vec4 WorldPosition();

                Matrix4 &   WorldMatrix();
                Matrix4 &   LocalMatrix();

                Matrix4 &   RotationMatrix();
                Matrix4 &   TranslationMatrix();

                vec4    &   Position();
                vec4    &   EulerAngles();

                void Parent(Transform & parent);
                Transform & Parent();

                float valuelol;
                void DisplayVector(vec4 vec);

            /********************************
            /*          Set
            /********************************/

                /*! @brief Translate the object, using it's current position as reference   */
                void Translate(float x, float y, float z);
                void Translate(const vec4 & vec);

                /*! @brief Translate the object at specified destination                    */
                void Translation(float x, float y, float z);

                /*! @brief Translate the object at specified destination                    */
                void Translation(vec4 vec);

                /*! @brief Rotate the objet using current rotation                          */
                void RotateEuler(float x, float y, float z);

                /*! @brief Set the Rotation of the object                                   */
                void RotationEuler(float x, float y, float z);

                 /*! @brief Rotate around specified axis                                 */
                void RotateAroundAxis(float x, float y, float z, float teta);


                void LookAt(vec4 & vec);
                void Clear();


                Matrix4 & ReturnModelMatrix();


        /********************************
        /*          Properties
        /********************************/

            bool        HasParent;
            bool        IsWorld;
            bool        IsView;

            vec4        *m_Position;         /*!< Vector3 Position                           */
            vec4        *m_EulerAngles;      /*!< Store current euler angles values          */

            Matrix4     *m_RotationMatrix;   /*!< Matrix Storing the position in space       */
            Matrix4     *m_PositionMatrix;   /*!< Matrix storing the rotation of the object  */

            Matrix4*    m_WorldMatrix;
            Matrix4*    m_LocalMatrix;

        /********************************
        /*          Private
        /********************************/
        private :

            /********************************
            /*          Methods
            /********************************/

                void InitializeDirectionsVectors();
                void UpdateDirectionsVector();

            /********************************
            /*          Properties
            /********************************/

                vec4        m_Forward;
                vec4        m_Right;
                vec4        m_Up;

                Transform   *   m_Parent;



        /********************************
        /*          Static
        /********************************/

            /********************************
            /*          Properties
            /********************************/

            /********************************
            /*          Methods
            /********************************/

};

#endif
